<?php

// 第三方支付通知回调控制器

namespace app\api\controller;

use app\api\controller\Base;
use app\api\model\PaymentOrder;
use think\facade\Cache;
use think\facade\Env;
use think\facade\Response;

class Notify extends Base
{

    /**
     * 第三方海贝支付通知
     */
    public function haibeifu()
    {
        try {
            if ($this->request->has('order_id') && $this->request->has('pay_fee') && $this->request->param('pay_state') == '10000') {
                $order_id = $this->request->param('agent_order');       // 平台订单号
                $cash = $this->request->param('pay_fee');               // 金额              
                $verify_param = $this->request->param('order_id');      // 验证参数    
                $other_order_id = $this->request->param('order_id');    // 第三方订单号  
                $now_cash = $cash;                                      // 实际金额                                    

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'haibeifu', true, false, true);
                if ($resdata == 'success') {
                    return Response::create('ok', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方优聚合支付通知
     */
    public function ujubank()
    {
        try {
            if ($this->request->has('out_trade_no') && $this->request->has('total_fee') && $this->request->param('result_code') == '0') {
                $order_id = $this->request->param('out_trade_no');         // 平台订单号
                $cash = $this->request->param('total_fee');                // 金额              
                $verify_param = $this->request->param('ordernumber');      // 验证参数    
                $other_order_id = $this->request->param('ordernumber');    // 第三方订单号  
                $now_cash = $cash;                                         // 实际金额                

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'ujubank', true, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方快接支付通知
     */
    public function kjpay()
    {
        try {
            if ($this->request->has('amount') && $this->request->has('merchant_order_no') && $this->request->param('status') == 'Success') {
                $order_id = $this->request->param('merchant_order_no');    // 平台订单号
                $cash = $this->request->param('amount');                   // 金额
                $verify_param = $this->request->param('trade_no');         // 验证参数
                $other_order_id = $this->request->param('trade_no');       // 第三方订单号    
                $now_cash = $cash;                                         // 实际金额        

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'kjpay', true, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方合利宝支付通知
     */
    public function helipay()
    {
        try {
            if ($this->request->has('rt6_orderAmount') && $this->request->has('rt12_serialNumber') && $this->request->param('rt11_orderStatus') == 'SUCCESS') {
                $order_id = $this->request->param('rt5_orderId');              // 平台订单号
                $cash = $this->request->param('rt6_orderAmount');              // 金额
                $verify_param = $this->request->param('rt13_desc');            // 验证参数
                $other_order_id = $this->request->param('rt12_serialNumber');  // 第三方订单号  
                $now_cash = $cash;                                             // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'helipay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方汇游通支付通知
     */
    public function huupay()
    {
        try {
            if ($this->request->has('r6_Order') && $this->request->has('r3_Amt') && $this->request->param('r1_Code') == '1') {
                $order_id = $this->request->param('r6_Order');              // 平台订单号
                $cash = $this->request->param('r3_Amt');                    // 金额
                $verify_param = $this->request->param('r2_TrxId');          // 验证参数
                $other_order_id = $this->request->param('r2_TrxId');        // 第三方订单号        
                $now_cash = $cash;                                          // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->returlAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'huupay', true, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方来店付支付通知
     */
    public function laidianfu()
    {
        try {
            if ($this->request->has('sdorderno') && $this->request->has('sdpayno') && $this->request->param('status') == '1') {
                $order_id = $this->request->param('sdorderno');        // 平台订单号
                $cash = $this->request->param('total_fee');            // 金额              
                $verify_param = $this->request->param('remark');       // 验证参数    
                $other_order_id = $this->request->param('sdpayno');    // 第三方订单号  
                $now_cash = $cash;                                     // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'laidianfu', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方优支付通知
     */
    public function youzhifu()
    {
        try {
            if ($this->request->has('sdorderno') && $this->request->has('sdpayno') && $this->request->param('status') == '1') {
                $order_id = $this->request->param('sdorderno');        // 平台订单号
                $cash = $this->request->param('total_fee');            // 金额              
                $verify_param = $this->request->param('remark');       // 验证参数    
                $other_order_id = $this->request->param('sdpayno');    // 第三方订单号  
                $now_cash = $cash;                                     // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'youzhifu', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方goifox支付通知
     */
    public function goifox()
    {
        try {
            if ($this->request->has('data') && $this->request->has('orderno')) {

                $data = $this->request->param('data');
                $merchant_id = '11134';
                $app_id = '5d27ea4456eac0e537552a1de827ae6285499c31';

                // 商户自己生成的私钥
                $private_key = '-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDW8hQKMe95p9roFEiwurDHS9yY2AwP0U/kcm3YP6b97hOb4pdV
sKuGTtumU+f3ulwo8vzdUP6loASXaXngULAVygyIap83czSCqPuPh4bdwR8TxMhy
MQxqa48VsvMBg7yalTkRsVDX2w2ugRGp/qo7gq3XkrWVJQ+v2LaB8iOpbQIDAQAB
AoGBALJnDIEFv0kPK98ybr7YxT81VOw7bY93YEMxQsCY3Eao4vegk5EY6NS6AQ9F
VyRDNpj6TSx4PFNFxGnTrsei0PJPXZHJKAYfnRqU+eGukL9baCsWVf7GeSipbKjm
yYbYwZfwjKM9kJVuQh2UJkwbUlMEmloPkQwVzLlIbYHVll+hAkEA72pCHxzJHlEV
16CJhiD03KWyLimiy6+bCtehpWzsPx7CmS7ohcgw2BwtczirJwY66aM7BkgXNppa
5LbQ7SdnmQJBAOXV4iG6TF9eRx15K0SY+AqXw0oBgEQ3XbGrHdXzF6vv23xASNB6
En68V6RYxU4DB9iL9iI12wJNEaW72BE8JPUCQBd5mcYnMmkwli2wZguqy5ee/5ub
JYVHULJ9djIcPgXqZDZU7SPA/1kRWjuEAPQwnjIueSkihHQsKmFms5GtXXECQQDT
K+RcpuZ7DY17yBP4MDBe0zgMrDpk8xX0I0wDgxpx0K0yiYIdgruxlG1WRHXsip5P
2bEpl6AFijg3tdL9auxtAkAHLzU/PjKbdwY8AQNI5Gp/g6md9E4/yp1iPj7V//xx
G0eSWQtV+dQxVViw7ZY0UPmCaU/ATIxfCYT/4hsGtvR5
-----END RSA PRIVATE KEY-----';

                // 商户自己生成的公钥
                $public_key = '-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDW8hQKMe95p9roFEiwurDHS9yY
2AwP0U/kcm3YP6b97hOb4pdVsKuGTtumU+f3ulwo8vzdUP6loASXaXngULAVygyI
ap83czSCqPuPh4bdwR8TxMhyMQxqa48VsvMBg7yalTkRsVDX2w2ugRGp/qo7gq3X
krWVJQ+v2LaB8iOpbQIDAQAB
-----END PUBLIC KEY-----';

                $data = str_replace(array('-', '_'), array('+', '/'), $data);
                $mod4 = strlen($data) % 4;
                if ($mod4) {
                    $data .= substr('====', $mod4);
                }
                $encrypted = base64_decode($data);

                $crypto = '';
                foreach (str_split($encrypted, 128) as $chunk) {
                    openssl_private_decrypt($chunk, $decryptData, $private_key);
                    $crypto .= $decryptData;
                }

                $resarray = json_decode($crypto, true);

                if ($resarray['status'] == 1) {

                    $order_id = $resarray['sdorderno'];        // 平台订单号
                    $cash = $resarray['total_fee'];            // 金额              
                    $verify_param = $resarray['remark'];       // 验证参数    
                    $other_order_id = $resarray['sdpayno'];    // 第三方订单号  
                    $now_cash = $cash;                         // 实际金额            

                    $payment_order_obj = new PaymentOrder();
                    $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'goifox', false, false, true);
                    if ($resdata == 'success') {
                        return Response::create('success', 'html');
                    }
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方汇通支付通知
     */
    public function huitong()
    {
        try {
            if ($this->request->has('amount') && $this->request->has('order') && $this->request->has('trade')) {
                $order_id = $this->request->param('order');         // 平台订单号
                $cash = $this->request->param('amount');            // 金额              
                $verify_param = $this->request->param('extra');     // 验证参数    
                $other_order_id = $this->request->param('trade');   // 第三方订单号  
                $now_cash = $cash;                                  // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'huitong', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方畅汇支付通知
     */
    public function changhui()
    {
        try {
            if ($this->request->has('r3_Amt') && $this->request->has('r2_TrxId') && $this->request->param('r1_Code') == '1') {
                $order_id = $this->request->param('r6_Order');             // 平台订单号
                $cash = $this->request->param('r3_Amt');                   // 金额
                $verify_param = $this->request->param('r8_MP');            // 验证参数
                $other_order_id = $this->request->param('r2_TrxId');       // 第三方订单号     
                $now_cash = $cash;                                         // 实际金额               

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'changhui', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方通宝付支付通知
     */
    public function paytbf()
    {
        try {
            if ($this->request->has('merchant_code') && $this->request->has('merchant_order') && $this->request->param('out_trade_no')) {
                $order_id = $this->request->param('merchant_order');        // 平台订单号
                $trans_amount = $this->request->param('trans_amount');      // 充值金额,单位为分              
                $verify_param = $this->request->param('out_trade_no');      // 验证参数    
                $other_order_id = $this->request->param('out_trade_no');    // 第三方订单号  
                $cash = $trans_amount / 100;                                // 金额  
                $now_cash = $cash;                                          // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'paytbf', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方恒闪通支付通知
     */
    public function hengshantong()
    {
        try {
            if ($this->request->has('merchant_code') && $this->request->has('merchant_order') && $this->request->param('order_status') == 'success') {
                $order_id = $this->request->param('merchant_order');        // 平台订单号
                $yufu_amount = $this->request->param('yufu_amount');        // 充值金额,单位为分              
                $verify_param = $this->request->param('out_trade_no');      // 验证参数    
                $other_order_id = $this->request->param('out_trade_no');    // 第三方订单号  
                $trans_amount = $this->request->param('trans_amount');      // 充值金额,单位为分 
                $cash = $yufu_amount / 100;                                 // 金额  
                $now_cash = $trans_amount / 100;                            // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'hengshantong', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方银牛星支付通知
     */
    public function hfnbuy()
    {
        try {
            if ($this->request->has('merchant_code') && $this->request->has('context')) {
                $merchant_code = $this->request->param('merchant_code');    // 商户号
                $notify_context = $this->request->param('context');         // 提取密文

                if ($this->request->param('merchant_code') == '100001') {
                    // 商户自己生成的私钥 
                    $merchant_private_key = '-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQDQgkSlURtFOvHl9ugXWlONTvM1JwEQPEp1jvJK+YiHbspJ+J0c
MgZilbzYxaEta63TTKRcVY2h01clqnXKaJgAVtuq6vVfEIyAMIkK0JCTf+6TJOof
ougzbQDzlEAWx1t5gE93eWuZ0bBUjD9EMw06fLV6WN3h6OmgVOfehl7yKQIDAQAB
AoGBAMxCIQ818hoS0W+vPdPKt7jhU52JNSB7f5HEVBUgeB/8Z4ypUPeTBfBDsblF
eUxuhN1O4mBVqyaRS3jpkPSVG/jMRd1ad8TBhSfY+YdOAJ11KvQ+mk+Ec4bslFnV
PsD3/+YMtl1qSho5J4XjGKTnAa55N9ToAorWq8grrOQDTvH1AkEA7a48ycbZr8AI
53ELGs6rYdv5GEk3xvc98GRuBeflfeAObQIaqHy7XeSFD3O/t2JjsZvlrNzlEszt
8ZAKEEobVwJBAOCUbqSGVROgG5jSZHGJOQ9ko3ISXGPewzhfZFylb+QzYmFY8RJo
zMpv4g8FiQnFTVBDtTv4TK5GVKkcmeeEbn8CQHa7uuxFpQuSECCmLRj4M09Ql1BV
i0Ke0ldbpEbZAKDwI+S6z1xp6yPNe9crSJOw2AKq0YKYWusYaqlo/k4C50MCQH11
DhYk4PQUtjX6Gph+YvzhaJk5/pjgAcjFKWjEFqyxs9zT9eAl4XmZZPylR/fIW7di
C6WTwSp+KZ9LVgLKrXsCQES6niR1NBUAjjCmxMr3/BAXPC4zfHHkuwxehXQxMNuT
o+/YdOWtH54CekZY6Ha+09ryOovrj/fiiP+Vo9boCOo=
-----END RSA PRIVATE KEY-----';

                    // 商户自己生成的公钥  
                    $merchant_public_key = '-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDQgkSlURtFOvHl9ugXWlONTvM1
JwEQPEp1jvJK+YiHbspJ+J0cMgZilbzYxaEta63TTKRcVY2h01clqnXKaJgAVtuq
6vVfEIyAMIkK0JCTf+6TJOofougzbQDzlEAWx1t5gE93eWuZ0bBUjD9EMw06fLV6
WN3h6OmgVOfehl7yKQIDAQAB
-----END PUBLIC KEY-----';

                    // 第三方公钥  
                    $other_public_key = '-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDKN/n80fwq5mB2iIUUCGs0vnZw
uFZXlGOb1HzFWe7RdrWDgyA1+DT3WqueqaYjc5stXnov/zZmBlQRruvfRRg6yhf5
7lSgLNjUcVeqehE16D1dY/kYCfObezY0jJjzOecbGWVYbHBkjZEoSMOlKrNCoNxF
ovA26R4Jr3nYBurTCwIDAQAB
-----END PUBLIC KEY-----';
                }

                if ($this->request->param('merchant_code') == '100010') {
                    // 商户自己生成的私钥 
                    $merchant_private_key = '-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQDFcBVoXXFGQEVLFUXgFhvFZ8DOa4yyvB0HW8iAVdTOhqRZpBII
SKImaARO90PBzWyz7fb+ZFuJmDoKXCm71e4D73CFOVVr9shh2sdLrBOc/8cOOsdz
Is3ZL9tH0dVBvb1d5w8jGrxZaF/BAMYc8TyL/v8t3jMUnhw2j+7A76uGtwIDAQAB
AoGBAMHxdQX87D1++tJjhi02andCkNH0MdSNFtLYpR7zsURiXGU11wTOHIIvoTPU
jnl8ijBBLGP+PzDtGO5+U/yQi+kV9/lKou6s8blGzzyDPGl1MzbNt6S0oiZ0j8Ar
n8PD+rCFkgHzRJsLe3yZMQ48mWJc73Xg3grlAaF3DTGd36fpAkEA5GnEh3PPn/W0
14uy9BsMjbwZTQWB/pZTuToYYU6yfCcnOhpo/dsDwg6L5pxI5UgmCrT8d66YTtuP
vqC20toXCwJBAN1ImYwJC497zHgdPv1DWVPkyiEOv3HylD/cBA26VUNJdKpYYL8C
zNjglBygUxd58JSUDPc8wtN0p8kAy7xZaoUCQQCcleWk9j/f6RGQsrR7pA93Gvw9
UQlM/sFmuez8yHaTpkO+EVzoqrxozJAcCAfxJwTtUiXB5m+DoAFrLcInylsBAkA4
EdNGVmxlePsAXHi/d7dEuK423iPIXa0O2VL1n4dHO2+iUi6Bd9YsBgvBjSZAxpcd
Lr5yTyUWq3JwThFRsl55AkEAscLgKvQmntSrY7dtd3GaZuvTr8C+fsbeNq9FNg9k
UzCMl/KkU3W2gNcdBhJNq95JhqFSdrNy87a991YKrgmbGA==
-----END RSA PRIVATE KEY-----';

                    // 商户自己生成的公钥  
                    $merchant_public_key = '-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDFcBVoXXFGQEVLFUXgFhvFZ8DO
a4yyvB0HW8iAVdTOhqRZpBIISKImaARO90PBzWyz7fb+ZFuJmDoKXCm71e4D73CF
OVVr9shh2sdLrBOc/8cOOsdzIs3ZL9tH0dVBvb1d5w8jGrxZaF/BAMYc8TyL/v8t
3jMUnhw2j+7A76uGtwIDAQAB
-----END PUBLIC KEY-----';

                    // 第三方公钥  
                    $other_public_key = '-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2thVf3C40okmpc6hEXRpUlySS
Li9TJp7d4NH8J3v+US4gdMF24OjTBSZ+xDa9igIvhM5NOKU5v9yvixz97IY5wZO7
fwiXLv1l7QvBjGpPnKBytEPyYY+EA0rJDzWNa/QNyJwb8eo/N78d8tK+5N8IXhy2
tNghmWZRXwsMCatIpQIDAQAB
-----END PUBLIC KEY-----';
                }

                $private_key = openssl_pkey_get_private($merchant_private_key);  // 取私钥资源号
                $public_key = openssl_pkey_get_public($other_public_key);        // 取公钥资源号

                $data = '';
                $decrypt_decode = base64_decode($notify_context);
                foreach (str_split($decrypt_decode, 128) as $chunk) {
                    openssl_private_decrypt($chunk, $decrypt_data, $private_key);
                    $data .= $decrypt_data;
                }

                $context_arr = json_decode($data, true);                // 转为数组格式
                $sign = $context_arr['businessHead']['sign'];           // 取SIGN
                $businessContext = $context_arr['businessContext'];     // 取businessContext

                ksort($businessContext);                                // 按ASCII码从小到大排序

                $json_businessContext = json_encode($businessContext, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
                $isVerify = (bool) openssl_verify($json_businessContext, base64_decode($sign), $public_key, OPENSSL_ALGO_MD5);

                if ($isVerify) {

                    if (strtolower($businessContext['order_status']) == 'success') {

                        $order_id = $businessContext['merchant_order'];         // 平台订单号
                        $trans_amount = $businessContext['yufu_amount'];        // 充值金额,单位为分              
                        $verify_param = $businessContext['out_trade_no'];       // 验证参数    
                        $other_order_id = $businessContext['out_trade_no'];     // 第三方订单号  
                        $cash = $trans_amount / 100;                            // 金额  
                        $now_cash = $businessContext['trans_amount'] / 100;     // 实际金额            

                        $payment_order_obj = new PaymentOrder();
                        $resdata = $payment_order_obj->notifyAbout($order_id, $businessContext, $cash, $now_cash, $verify_param, $other_order_id, 'hfnbuy', true, false, true);
                        if ($resdata == 'success') {

                            $head = [
                                'charset' => '00',
                                'version' => 'V1.1.0',
                                'merchantNumber' => $merchant_code,
                                'tradeType' => 'quickPayApi',
                                'requestTime' => date("YmdHis"),
                                'signType' => 'RSA',
                                'sign' => '',
                            ];
                            $context['response_result_status'] = 'success';

                            ksort($context);
                            $json_context = json_encode($context, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);

                            openssl_sign($json_context, $sign, $private_key, OPENSSL_ALGO_MD5); // 根据提供的私钥进行订单签名

                            $sign = base64_encode($sign);    // 最终的签名　
                            $head['sign'] = $sign;           // 将签名加入businessHead中

                            $arr['businessContext'] = $context;
                            $arr['businessHead'] = $head;

                            $json_arr = json_encode($arr);

                            $encrypt = '';
                            foreach (str_split($json_arr, 117) as $chunk) {
                                openssl_public_encrypt($chunk, $encrypt_data, $public_key);
                                $encrypt .= $encrypt_data;
                            }
                            $encrypt = base64_encode($encrypt);
                            $resarray = ['message' => ['code' => 200, 'content' => '成功'], 'success' => 1, 'context' => $encrypt];
                            return $resarray;
                        }
                    }
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            $order_id = isset($order_id) ? $order_id : 0;
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方北付宝支付通知
     */
    public function beifubao()
    {
        try {
            // 取POST过来的JSON数据，普通的$_POST无法取值
            $notify_data = json_decode(file_get_contents('php://input'), true);
            if (isset($notify_data['success']) && $notify_data['success'] == 'true') {
                $notify_context = $notify_data['context'];    // 提取密文

                $merchant_private_key = '-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDVkX1GF/oQ2VrYfvlQZzHGcBFYVWEk1sy2lny4CtdsPYXF4TjR
FZrtoSXoXjMqlwkvBoEBxbJ/b8Lcga84YCXQfce3tw/p5z3f1anmmL4fVk8z/CZf
gP9QjkgzntpC+K6l0QEinJF9XdzqBXwJEhLfmsIG77LT08HM6CleFvyUEQIDAQAB
AoGBAMEOysrRI9mVUj0A0wjusB0s81EBpVYy4k1vzgBktIYBO2s8hCrlt+51zRm4
BdLLQ58B5x6eAxSWB/VjOezhZWviGwBrh3U5QhpPs7pFaloKv2abOQ/I5cQPxf+C
tHiqBZnjIvR+/iGWmswHEPpIOiaeA2IkVHDUmMbRwownW1e9AkEA/W1Y/uw6aehp
nxBGaOkXBD1r+yXqWUWBnXQYYqokGWM6Pm8Ry88UwJK3lDh6AEVkUhjB6sRPVU57
AwF+aCLqCwJBANe8jKR+7aw0TqLqLm9yKobTLKVdJIj1cN7aJocUGbXrCVuBokD7
ch9GFJ5CqJbupJ2B976nXCJIAcGloRhqJ9MCQQC9MYsFFRouwqFHbIEEBS93rNsW
LaIcbzVqdKdX0SkOAvQSdBzXCIu3kFCYyOjblvJkD7OFLnUDfIl9Hvpdh+MtAkB4
+lvoFuGTEtYSF76ocl4UszEzHjNRtklwPuciEoyEbmQV83EYfai2jucbBIhj8zlO
tkZGnLVW6AhMHmRjO4xPAkAgIkeJpMjnXrIL2HghS9c3fBffGhx1196Ug3LXlopE
anxhVHdPNnaVLo06woT/RqL4WHU8WELJbWcYPwFmJ2RO
-----END RSA PRIVATE KEY-----';
                /* 商户自己生成的私钥 */

                $merchant_public_key = '-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVkX1GF/oQ2VrYfvlQZzHGcBFY
VWEk1sy2lny4CtdsPYXF4TjRFZrtoSXoXjMqlwkvBoEBxbJ/b8Lcga84YCXQfce3
tw/p5z3f1anmmL4fVk8z/CZfgP9QjkgzntpC+K6l0QEinJF9XdzqBXwJEhLfmsIG
77LT08HM6CleFvyUEQIDAQAB
-----END PUBLIC KEY-----';
                /* 商户自己生成的公钥 */

                $other_public_key = '-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7PPk5VJeAfn4PznsXEr9G1eO1
iWF9PQs7aRGRQa2kgqHrpkLDlCvrzMeg3av9AyK+gtoiZ8TjzccBXOvetwo5nAM+
0uDGDWhFtzXHKzoXk+t4Oa5jUNOPC44FPEeQPzOhePDfkeR8TiGATUF+cmXiHyG9
 AsDY8dts9U2Yk9FTmQIDAQAB
-----END PUBLIC KEY-----';

                $private_key = openssl_pkey_get_private($merchant_private_key);  // 取私钥资源号
                $public_key = openssl_pkey_get_public($other_public_key);        // 取公钥资源号

                $data = '';
                $decrypt_decode = base64_decode($notify_context);
                foreach (str_split($decrypt_decode, 128) as $chunk) {
                    openssl_private_decrypt($chunk, $decrypt_data, $private_key);
                    $data .= $decrypt_data;
                }

                $context_arr = json_decode($data, true);              // 转为数组格式
                $sign = $context_arr['businessHead']['sign'];         // 取SIGN

                $businessContext = $context_arr['businessContext'];   // 取businessContext

                ksort($businessContext);                              // 按ASCII码从小到大排序

                $json_businessContext = json_encode($businessContext, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
                $isVerify = (bool) openssl_verify($json_businessContext, base64_decode($sign), $public_key, OPENSSL_ALGO_MD5);
                if ($isVerify) {

                    if (strtolower($businessContext['orderStatus']) == 'success') {

                        $order_id = $businessContext['memberOrderNumber'];        // 平台订单号
                        $trans_amount = $businessContext['tradeAmount'];          // 充值金额,单位为分              
                        $verify_param = $businessContext['lxbOrderNumber'];       // 验证参数    
                        $other_order_id = $businessContext['lxbOrderNumber'];     // 第三方订单号  
                        $cash = $trans_amount / 100;                              // 金额  
                        $now_cash = $cash;                                        // 实际金额            

                        $payment_order_obj = new PaymentOrder();
                        $resdata = $payment_order_obj->notifyAbout($order_id, $businessContext, $cash, $now_cash, $verify_param, $other_order_id, 'beifubao', true, false, true);
                        if ($resdata == 'success') {
                            return Response::create('SUC', 'html');
                        }
                    }
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            $order_id = isset($order_id) ? $order_id : 0;
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方小强支付通知
     */
    public function xiaoqiang()
    {
        try {
            $resdata = file_get_contents('php://input');
            $resarray = json_decode($resdata, true);
            if (isset($resarray['request']['status']) && $resarray['request']['status'] == '100') {
                $order_id = $resarray['request']['cusOrderNo'];           // 平台订单号
                $cash = $resarray['request']['orderAmt'];                 // 金额              
                $verify_param = $resarray['request']['cusOrderNo'];       // 验证参数    
                $other_order_id = $resarray['request']['orderNo'];        // 第三方订单号 
                $now_cash = $resarray['request']['payAmt'];               // 实际金额      
                $cash /= 100;
                $now_cash /= 100;

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'xiaoqiang', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方天道支付通知
     */
    public function tiandao()
    {
        try {
            if ($this->request->has('mch_id') && $this->request->has('order_id') && $this->request->param('trade_state') == '8') {
                $order_id = $this->request->param('order_id');                // 平台订单号
                $trans_amount = $this->request->param('amount');              // 充值金额,单位为分              
                $verify_param = $this->request->param('order_id');            // 验证参数    
                $other_order_id = $this->request->param('up_order_id');       // 第三方订单号  
                $cash = $trans_amount / 100;                                  // 金额  
                $now_cash = $cash;                                            // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'tiandao', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方荔滔博支付通知
     */
    public function litaobo()
    {
        try {
            if ($this->request->has('amount') && $this->request->has('merNo') && $this->request->param('respCode') == '0000') {
                $order_id = $this->request->param('orderNo');                 // 平台订单号
                $cash = $this->request->param('amount');                      // 金额              
                $verify_param = $this->request->param('orderNo');             // 验证参数    
                $other_order_id = $this->request->param('platOrderNo');       // 第三方订单号 
                $now_cash = $cash;                                            // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'litaobo', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方大自在支付通知
     */
    public function dazizai()
    {
        try {
            if ($this->request->has('no_order') && $this->request->has('money_order') && $this->request->param('result_code') == '9999') {
                $order_id = $this->request->param('no_order');                 // 平台订单号
                $cash = $this->request->param('money_order');                  // 金额              
                $verify_param = $this->request->param('no_order');             // 验证参数    
                $other_order_id = $this->request->param('no_order');           // 第三方订单号 
                $now_cash = $cash;                                             // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'dazizai', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方卡秀支付通知
     */
    public function kaxiupay()
    {
        try {
            if ($this->request->has('sysorderid') && $this->request->has('ovalue') && $this->request->param('opstate') == '0') {
                $order_id = $this->request->param('orderid');                 // 平台订单号
                $cash = $this->request->param('ovalue');                      // 金额              
                $verify_param = $this->request->param('attach');              // 验证参数    
                $other_order_id = $this->request->param('sysorderid');        // 第三方订单号 
                $now_cash = $cash;                                            // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'kaxiupay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('ok', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方惠清云支付通知
     */
    public function huiqingpay()
    {
        try {
            if ($this->request->has('sysorderid') && $this->request->has('ovalue') && $this->request->param('opstate') == '0') {
                $order_id = $this->request->param('orderid');                 // 平台订单号
                $cash = $this->request->param('ovalue');                      // 金额              
                $verify_param = $this->request->param('attach');              // 验证参数    
                $other_order_id = $this->request->param('sysorderid');        // 第三方订单号 
                $now_cash = $cash;                                            // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'huiqingpay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('ok', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方尚和支付通知
     */
    public function shanghe()
    {
        try {
            if ($this->request->has('out_trade_no') && $this->request->has('total_fee') && $this->request->param('trade_state') == 'S') {
                $order_id = $this->request->param('out_trade_no');              // 平台订单号
                $cash = $this->request->param('total_fee');                     // 金额              
                $verify_param = $this->request->param('out_trade_no');          // 验证参数    
                $other_order_id = $this->request->param('trade_no');            // 第三方订单号 
                $now_cash = $cash;                                              // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'shanghe', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方平安付通知
     */
    public function pinganfupay()
    {
        try {
            if ($this->request->has('ordernumber') && $this->request->has('sysnumber') && $this->request->param('orderstatus') == '1') {
                $order_id = $this->request->param('ordernumber');              // 平台订单号
                $cash = $this->request->param('paymoney');                     // 金额              
                $verify_param = $this->request->param('attach');               // 验证参数    
                $other_order_id = $this->request->param('sysnumber');          // 第三方订单号 
                $now_cash = $cash;                                             // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'pinganfupay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('ok', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方支付转账通知
     */
    public function paytransfer()
    {
        try {
            if ($this->request->has('order_id') && $this->request->has('merchant_order_id') && $this->request->param('status') == 'settled') {
                $order_id = $this->request->param('merchant_order_id');          // 平台订单号
                $cash = $this->request->param('price');                          // 金额              
                $verify_param = $this->request->param('order_id');               // 验证参数    
                $other_order_id = $this->request->param('order_id');             // 第三方订单号 
                $now_cash = $cash;                                               // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'paytransfer', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方百盛嘉支付通知
     */
    public function bsjpay()
    {
        try {
            if ($this->request->has('orderid') && $this->request->has('amount') && $this->request->param('returncode') == '00') {
                $order_id = $this->request->param('orderid');                     // 平台订单号
                $cash = $this->request->param('amount');                          // 金额              
                $verify_param = $this->request->param('reserved1');               // 验证参数    
                $other_order_id = $this->request->param('orderid');               // 第三方订单号 
                $now_cash = $cash;                                                // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'bsjpay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('OK', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方西西支付通知
     */
    public function xixipay()
    {
        try {
            if ($this->request->has('orderid') && $this->request->has('amount') && $this->request->param('returncode') == '00') {
                $order_id = $this->request->param('orderid');                     // 平台订单号
                $cash = $this->request->param('amount');                          // 金额              
                $verify_param = $this->request->param('attach');                  // 验证参数    
                $other_order_id = $this->request->param('orderid');               // 第三方订单号 
                $now_cash = $cash;                                                // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'xixipay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('OK', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方柬易付支付通知
     */
    public function jianyifu()
    {
        try {
            if ($this->request->has('appkey')) {
                $data = $this->request->param('data');
                $array = json_decode($data, true);
                if (isset($array['status']) && $array['status'] == 1) {

                    $order_id = $array['order_id'];                     // 平台订单号
                    $cash = $array['money'];                            // 金额              
                    $verify_param = $array['remark'];                   // 验证参数    
                    $other_order_id = $array['third_order_id'];         // 第三方订单号 
                    $now_cash = $cash;                                  // 实际金额            

                    $payment_order_obj = new PaymentOrder();
                    $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'jianyifu', false, false, true);
                    if ($resdata == 'success') {
                        return Response::create('success', 'html');
                    }
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方看富支付通知
     */
    public function kehupay()
    {
        try {
            if ($this->request->has('data')) {
                $data = $this->request->param('data');
                $array = json_decode($data, true);
                if (isset($array['payStatus']) && $array['payStatus'] == 1) {

                    $order_id = substr($array['orderNo'], 8);             // 平台订单号
                    $txnAmt = $array['txnAmt'];                           // 充值金额,单位为分              
                    $verify_param = $array['orderid'];                    // 验证参数    
                    $other_order_id = $array['orderid'];                  // 第三方订单号 
                    $cash = $txnAmt / 100;                                // 金额
                    $now_cash = $cash;                                    // 实际金额            

                    $payment_order_obj = new PaymentOrder();
                    $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'kehupay', true, false, true);
                    if ($resdata == 'success') {
                        return Response::create('SUCCESS', 'html');
                    }
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            $order_id = isset($order_id) ? $order_id : 0;
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方付联支付通知
     */
    public function fulian()
    {
        try {
            $data_json = file_get_contents('php://input');
            $data = json_decode($data_json, true);
            if (isset($data['payStatus']) && $data['payStatus'] == 'S') {

                $order_id = $data['merOrderNo'];                   // 平台订单号
                $cash = $data['orderAmt'];                         // 金额              
                $verify_param = $data['payNo'];                    // 验证参数    
                $other_order_id = $data['payNo'];                  // 第三方订单号 
                $now_cash = $data['realAmt'];                      // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, $data_json, $cash, $now_cash, $verify_param, $other_order_id, 'fulian', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方多米支付通知
     */
    public function duomi()
    {
        try {
            if ($this->request->has('orderNo') && $this->request->has('orderAmount') && $this->request->param('orderStatus') == '1') {
                $order_id = $this->request->param('orderNo');                    // 平台订单号
                $cash = $this->request->param('orderAmount');                    // 金额              
                $verify_param = $this->request->param('orderNo');                // 验证参数    
                $other_order_id = $this->request->param('thridOrderNo');         // 第三方订单号 
                $now_cash = $cash;                                               // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'duomi', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方付易通支付通知
     */
    public function fuyitong()
    {
        try {
            if ($this->request->has('out_trade_no') && $this->request->has('total_fee')) {
                $order_id = $this->request->param('out_trade_no');                  // 平台订单号
                $total_fee = $this->request->param('total_fee');                    // 充值金额,单位为分              
                $verify_param = $this->request->param('attach');                    // 验证参数    
                $other_order_id = $this->request->param('out_trade_no');            // 第三方订单号 
                $cash = $total_fee / 100;                                           // 金额  
                $now_cash = $cash;                                                  // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'fuyitong', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方兆行支付通知
     */
    public function zhaohang()
    {
        try {
            if ($this->request->has('orderCode') && $this->request->has('price')) {
                $order_id = $this->request->param('orderCode');                   // 平台订单号
                $cash = $this->request->param('price');                           // 金额              
                $verify_param = $this->request->param('remarks');                 // 验证参数    
                $other_order_id = $this->request->param('tradeNo');               // 第三方订单号 
                $now_cash = $cash;                                                // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'zhaohang', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方保盈支付通知
     */
    public function baoying()
    {
        try {
            if ($this->request->has('orderId') && $this->request->has('amount') && $this->request->param('pay_msg') == 'SUCCESS') {
                $order_id = $this->request->param('orderId');           // 平台订单号
                $cash = $this->request->param('amount');                // 金额              
                $verify_param = $this->request->param('orderId');       // 验证参数    
                $other_order_id = $this->request->param('orderId');     // 第三方订单号    
                $now_cash = $cash;                                      // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'baoying', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方付玲珑支付通知
     */
    public function fulinglong()
    {
        try {
            if ($this->request->has('out_trade_no') && $this->request->has('total_fee') && $this->request->param('result_code') == '0') {
                $order_id = $this->request->param('out_trade_no');         // 平台订单号
                $cash = $this->request->param('total_fee');                // 金额              
                $verify_param = $this->request->param('attach');           // 验证参数    
                $other_order_id = $this->request->param('ordernumber');    // 第三方订单号    
                $now_cash = $cash;                                         // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'fulinglong', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方yokoy支付通知
     */
    public function yokoy()
    {
        try {
            if ($this->request->has('orderNo') && $this->request->has('outTradeNo') && $this->request->param('status') == 'paid') {
                $order_id = $this->request->param('outTradeNo');         // 平台订单号
                $totalFee = $this->request->param('totalFee');           // 充值金额,单位为分              
                $verify_param = $this->request->param('orderNo');        // 验证参数    
                $other_order_id = $this->request->param('orderNo');      // 第三方订单号   
                $cash = $totalFee / 100;                                 // 金额            
                $now_cash = $cash;                                       // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'yokoy', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('SUCCESS', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方小差事支付通知
     */
    public function xiaochaishi()
    {
        try {
            if ($this->request->has('order_no') && $this->request->has('partner_order_no')) {
                $order_id = $this->request->param('partner_order_no');         // 平台订单号
                $cash = $this->request->param('payment_money');                // 金额              
                $verify_param = $this->request->param('order_no');             // 验证参数    
                $other_order_id = $this->request->param('order_no');           // 第三方订单号   
                $now_cash = $cash;                                             // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'xiaochaishi', true, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方绿洲支付通知
     */
    public function luzhou()
    {
        try {
            if ($this->request->has('orderAmount') && $this->request->has('prdOrdNo') && $this->request->param('orderStatus') == '01') {
                $order_id = $this->request->param('prdOrdNo');         // 平台订单号
                $orderAmount = $this->request->param('orderAmount');   // 充值金额,单位为分                            
                $verify_param = $this->request->param('payId');        // 验证参数    
                $other_order_id = $this->request->param('payId');      // 第三方订单号   
                $cash = $orderAmount / 100;                            // 金额      
                $now_cash = $cash;                                     // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'luzhou', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('SUCCESS', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方云付支付通知
     */
    public function yunfu()
    {
        try {
            if ($this->request->has('orderid') && $this->request->has('price') && $this->request->param('status') == '1') {
                $order_id = $this->request->param('cpparam');               // 平台订单号
                $orderAmount = $this->request->param('price');              // 充值金额,单位为分                            
                $verify_param = $this->request->param('orderid');           // 验证参数    
                $other_order_id = $this->request->param('orderid');         // 第三方订单号   
                $cash = $orderAmount / 100;                                 // 金额      
                $now_cash = $cash;                                          // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'yunfu', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('ok', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方pexotc支付通知
     */
    public function pexotc()
    {
        try {
            if ($this->request->has('orderno') && $this->request->has('orderamount') && $this->request->param('status') == '1') {
                $order_id = $this->request->param('orderno');               // 平台订单号
                $cash = $this->request->param('orderamount');               // 金额                         
                $verify_param = $this->request->param('orderno');           // 验证参数    
                $other_order_id = $this->request->param('orderno');         // 第三方订单号   
                $now_cash = $this->request->param('payamount');             // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'pexotc', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('{"reason":"success"}', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方安全支付通知
     */
    public function safepay()
    {
        try {
            if ($this->request->has('orderId') && $this->request->has('amt') && $this->request->param('succ') == 'Y') {
                $order_id = $this->request->param('orderId');               // 平台订单号
                $cash = $this->request->param('amt');                       // 金额                         
                $verify_param = $this->request->param('attach');            // 验证参数    
                $other_order_id = $this->request->param('orderId');         // 第三方订单号   
                $now_cash = $this->request->param('amt');                   // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'safepay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('{"reason":"success"}', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方汇付通支付通知
     */
    public function huifutong()
    {
        try {
            if ($this->request->has('out_trade_no') && $this->request->has('total_fee') && $this->request->param('result_code') == '0') {
                $order_id = $this->request->param('out_trade_no');         // 平台订单号
                $cash = $this->request->param('total_fee');                // 金额              
                $verify_param = $this->request->param('ordernumber');      // 验证参数    
                $other_order_id = $this->request->param('ordernumber');    // 第三方订单号  
                $now_cash = $cash;                                         // 实际金额                

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'huifutong', true, false, true);
                if ($resdata == 'success') {
                    return Response::create('SUCCESS', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方美团支付通知
     */
    public function meituanpay()
    {
        try {
            if ($this->request->param('payStatus') == 'cancel') {
                return;
            }

            if ($this->request->has('outTradeNo') && $this->request->has('totalFee') && $this->request->param('tradeStatus') == 'TRADE_SUCCESS') {
                $order_id = $this->request->param('outTradeNo');              // 平台订单号
                $totalFee = $this->request->param('totalFee');                // 金额              
                $verify_param = $this->request->param('outTradeNo');          // 验证参数    
                $other_order_id = $this->request->param('transactionId');     // 第三方订单号  
                $cash = $totalFee / 100;
                $now_cash = $cash;                                            // 实际金额   

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'meituanpay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('{"status": "SUCCESS"}', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方易付支付通知
     */
    public function yifu()
    {
        try {
            $xml = file_get_contents('php://input');
            $data = str_replace('\/', '/', $xml);
            $xml_obj = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA);
            $xml_json = json_encode($xml_obj, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
            $resarray = json_decode($xml_json, true);

            if (isset($resarray['data']['tStatus']) && $resarray['data']['tStatus'] == '1') {
                $order_id = $resarray['head']['reqNo'];            // 平台订单号
                $cash = $resarray['data']['allFee'];               // 金额              
                $verify_param = $resarray['head']['reqNo'];        // 验证参数    
                $other_order_id = $resarray['head']['respNo'];     // 第三方订单号  
                $now_cash = $resarray['data']['allFee'];           // 实际金额   
                $cash /= 100;
                $now_cash /= 100;

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, $resarray, $cash, $now_cash, $verify_param, $other_order_id, 'yifu', true, false, true);
                if ($resdata == 'success') {
                    return Response::create('0000', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方三通付通知
     */
    public function threelink()
    {
        try {
            if ($this->request->has('amount') && $this->request->has('merchant_order_no') && $this->request->param('status') == 'Success') {
                $order_id = $this->request->param('merchant_order_no');    // 平台订单号
                $cash = $this->request->param('amount');                   // 金额
                $verify_param = $this->request->param('trade_no');         // 验证参数
                $other_order_id = $this->request->param('trade_no');       // 第三方订单号    
                $now_cash = $cash;                                         // 实际金额        

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'threelink', true, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方Y付通知
     */
    public function yfu()
    {
        try {
            if ($this->request->has('orderid') && $this->request->has('amount') && $this->request->param('returncode') == '00') {
                $order_id = $this->request->param('orderid');               // 平台订单号
                $cash = $this->request->param('amount');                    // 金额
                $verify_param = $this->request->param('attach');            // 验证参数
                $other_order_id = $this->request->param('transaction_id');  // 第三方订单号    
                $now_cash = $cash;                                          // 实际金额        

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'yfu', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('ok', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方鑫汇支付通知
     */
    public function xinhui()
    {
        try {
            if ($this->request->has('orderid') && $this->request->has('amount') && $this->request->param('returncode') == '00') {
                $order_id = $this->request->param('orderid');               // 平台订单号
                $cash = $this->request->param('amount');                    // 充值金额               
                $verify_param = $this->request->param('attach');            // 验证参数    
                $other_order_id = $this->request->param('transaction_id');  // 第三方订单号         
                $now_cash = $this->request->param('amount');                // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'xinhui', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('OK', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方恒生支付通知
     */
    public function hengsheng()
    {
        try {
            if ($this->request->has('orderid') && $this->request->has('amount') && $this->request->param('returncode') == '00') {
                $order_id = $this->request->param('orderid');               // 平台订单号
                $cash = $this->request->param('amount');                    // 充值金额               
                $verify_param = $this->request->param('attach');            // 验证参数    
                $other_order_id = $this->request->param('transaction_id');  // 第三方订单号         
                $now_cash = $this->request->param('amount');                // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'xinhui', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('OK', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方王牌支付通知
     */
    public function wangpai()
    {
        try {
            if ($this->request->has('orderid') && $this->request->has('amount') && $this->request->param('returncode') == '00') {
                $order_id = $this->request->param('orderid');               // 平台订单号
                $cash = $this->request->param('amount');                    // 充值金额               
                $verify_param = $this->request->param('attach');            // 验证参数    
                $other_order_id = $this->request->param('transaction_id');  // 第三方订单号         
                $now_cash = $this->request->param('amount');                // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'wangpai', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('OK', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方宝宝支付通知
     */
    public function baobao()
    {
        try {
            if ($this->request->has('orderid') && $this->request->has('amount') && $this->request->param('returncode') == '00') {
                $order_id = $this->request->param('orderid');               // 平台订单号
                $cash = $this->request->param('amount');                    // 充值金额               
                $verify_param = $this->request->param('attach');            // 验证参数    
                $other_order_id = $this->request->param('transaction_id');  // 第三方订单号         
                $now_cash = $this->request->param('amount');                // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'baobao', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('OK', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方汇合支付通知
     */
    public function huihe()
    {
        try {
            if ($this->request->has('mchOrderNo') && $this->request->has('amount') && $this->request->param('status') == '2') {
                $order_id = $this->request->param('mchOrderNo');            // 平台订单号
                $amount = $this->request->param('amount');                  // 充值金额               
                $verify_param = $this->request->param('mchOrderNo');        // 验证参数    
                $other_order_id = $this->request->param('payOrderId');      // 第三方订单号         
                $cash = $amount / 100;                                      // 金额            
                $now_cash = $cash;                                          // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'huihe', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方新图支付通知
     */
    public function xintu()
    {
        try {
            if ($this->request->has('order_no') && $this->request->has('amount')) {
                $order_no = $this->request->param('order_no');               // 平台订单号
                $order_id = substr($order_no, 1);                            // 平台订单号
                $cash = $this->request->param('amount');                     // 金额
                $verify_param = $this->request->param('trade_no');           // 验证参数
                $other_order_id = $this->request->param('trade_no');         // 第三方订单号    
                $now_cash = $this->request->param('receipt_amount');         // 实际金额        

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'xintu', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方微互宝支付通知
     */
    public function weihupay()
    {
        try {
            if ($this->request->has('out_tradeid') && $this->request->has('amount') && $this->request->param('pay_result') == '0') {
                $order_id = $this->request->param('out_tradeid');         // 平台订单号
                $amount = $this->request->param('amount');                // 充值金额,单位为分              
                $verify_param = $this->request->param('attach');          // 验证参数    
                $other_order_id = $this->request->param('tradeid');       // 第三方订单号   
                $cash = $amount / 100;                                    // 金额            
                $now_cash = $cash;                                        // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'weihupay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方ONE支付通知
     */
    public function onepayment()
    {
        try {
            if ($this->request->has('callbackData')) {
                $content = $this->request->param('callbackData');
                $json_arr = json_decode($content, true);
                if ($json_arr['txnSta'] == '0000') {
                    $order_id = $json_arr['merOrderNo'];           // 平台订单号
                    $cash = $json_arr['txnAmt'];                   // 充值金额               
                    $verify_param = $json_arr['remarks'];          // 验证参数    
                    $other_order_id = $json_arr['txnOrderNo'];     // 第三方订单号   
                    $now_cash = $cash;                             // 实际金额            

                    $payment_order_obj = new PaymentOrder();
                    $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'onepayment', false, false, true);
                    if ($resdata == 'success') {
                        return Response::create('success', 'html');
                    }
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方阿联支付通知
     */
    public function alianpay()
    {
        try {
            $data = file_get_contents('php://input');
            $notify_data = json_decode($data, true);
            if (isset($notify_data['status']) && $notify_data['status'] == 'S') {
                $order_id = $notify_data['mch_order_id'];          // 平台订单号
                $money = $notify_data['money'];                    // 充值金额              
                $verify_param = $notify_data['reserve'];           // 验证参数    
                $other_order_id = $notify_data['sys_order_id'];    // 第三方订单号   
                $cash = $money / 100;                              // 金额            
                $now_cash = $cash;                                 // 实际金额          

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, $data, $cash, $now_cash, $verify_param, $other_order_id, 'alianpay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('SUCCESS', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方信通支付通知
     */
    public function xintong()
    {
        try {
            if ($this->request->has('orderNo') && $this->request->has('outTradeNo') && $this->request->param('status') == 'paid') {
                $order_id = $this->request->param('outTradeNo');         // 平台订单号
                $totalFee = $this->request->param('totalFee');           // 充值金额,单位为分              
                $verify_param = $this->request->param('orderNo');        // 验证参数    
                $other_order_id = $this->request->param('orderNo');      // 第三方订单号   
                $cash = $totalFee / 100;                                 // 金额            
                $now_cash = $cash;                                       // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'xintong', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('SUCCESS', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方优付支付通知
     */
    public function youfu()
    {
        try {
            if ($this->request->has('orderNo') && $this->request->has('orderAmount') && $this->request->param('orderStatus') == 'SUCCESS') {
                $order_id = $this->request->param('orderNo');            // 平台订单号
                $orderAmount = $this->request->param('orderAmount');     // 充值金额,单位为分              
                $verify_param = $this->request->param('orderNo');        // 验证参数    
                $other_order_id = $this->request->param('wtfOrderNo');   // 第三方订单号   
                $cash = $orderAmount / 100;                              // 金额            
                $now_cash = $cash;                                       // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'youfu', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('SUCCESS', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方super支付通知
     */
    public function superpay()
    {
        try {
            if ($this->request->has('out_order_no') && $this->request->has('trade_money')) {
                $order_id = $this->request->param('out_order_no');            // 平台订单号
                $cash = $this->request->param('trade_money');                 // 充值金额              
                $verify_param = $this->request->param('order_no');            // 验证参数    
                $other_order_id = $this->request->param('order_no');          // 第三方订单号   
                $now_cash = $cash;                                            // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'superpay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方白菜支付通知
     */
    public function baicai()
    {
        try {
            if ($this->request->has('spTradeId') && $this->request->has('payAmount') && $this->request->param('tradeState') == 'TRADE_STATE_END1') {
                $order_id = $this->request->param('spTradeId');            // 平台订单号
                $payAmount = $this->request->param('payAmount');           // 充值金额,单位为分              
                $verify_param = $this->request->param('bcTradeId');        // 验证参数    
                $other_order_id = $this->request->param('bcTradeId');      // 第三方订单号   
                $cash = $payAmount / 100;                                  // 金额            
                $now_cash = $cash;                                         // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'baicai', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方中富通支付通知
     */
    public function zhongfutong()
    {
        try {
            if ($this->request->has('orderNum') && $this->request->has('amount') && $this->request->param('orderStatus') == 'SUCCESS') {
                $order_id = $this->request->param('orderNum');            // 平台订单号
                $amount = $this->request->param('amount');                // 充值金额,单位为分              
                $verify_param = $this->request->param('orderNum');        // 验证参数    
                $other_order_id = $this->request->param('orderNum');      // 第三方订单号   
                $cash = $amount / 100;                                    // 金额            
                $now_cash = $cash;                                        // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'zhongfutong', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('SUCCESS', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方薇支付通知
     */
    public function vivpayment()
    {
        try {
            $data_json = file_get_contents('php://input');
            $data = json_decode($data_json, true);
            if (isset($data['orderStatus']) && $data['orderStatus'] == '0') {
                $order_id = $data['merchantTradeNo'];                 // 平台订单号
                $cash = $data['totalAmount'];                         // 金额              
                $verify_param = $data['merchantTradeNo'];             // 验证参数    
                $other_order_id = $data['SystemTradeNo'];             // 第三方订单号 
                $now_cash = $cash;                                    // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, $data, $cash, $now_cash, $verify_param, $other_order_id, 'vivpayment', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('SUCCESS', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方汇腾支付通知
     */
    public function huiteng()
    {
        try {
            if ($this->request->has('sdorderno') && $this->request->has('sdpayno') && $this->request->param('status') == '1') {
                $order_id = $this->request->param('sdorderno');        // 平台订单号
                $cash = $this->request->param('total_fee');            // 金额              
                $verify_param = $this->request->param('remark');       // 验证参数    
                $other_order_id = $this->request->param('sdpayno');    // 第三方订单号  
                $now_cash = $cash;                                     // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'huiteng', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方杉德支付通知
     */
    public function sandpay()
    {
        try {
            if ($this->request->has('data')) {
                $data_json = $this->request->param('data');
                $data = json_decode($data_json, true);
                if (isset($data['body']['orderStatus']) && $data['body']['orderStatus'] == 1) {
                    $order_id = $data['body']['orderCode'];            // 平台订单号
                    $cash = ltrim($data['body']['totalAmount'], '0');  // 金额              
                    $verify_param = $data['body']['extend'];           // 验证参数    
                    $other_order_id = $data['body']['bankserial'];     // 第三方订单号  
                    $cash /= 100;
                    $now_cash = $cash;                                 // 实际金额            

                    $payment_order_obj = new PaymentOrder();
                    $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'sandpay', false, false, true);
                    if ($resdata == 'success') {
                        return Response::create('respCode=000000', 'html');
                    }
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方智付支付通知
     */
    public function zhifu()
    {
        try {
            if ($this->request->has('custOrderNo') && $this->request->has('ordAmt') && $this->request->param('ordStatus') == '01') {
                $order_id = $this->request->param('custOrderNo');         // 平台订单号
                $ordAmt = $this->request->param('ordAmt');                // 充值金额,单位为分              
                $verify_param = $this->request->param('prdOrdNo');        // 验证参数    
                $other_order_id = $this->request->param('prdOrdNo');      // 第三方订单号  
                $payAmt = $this->request->param('payAmt');
                $cash = $ordAmt / 100;                                    // 金额            
                $now_cash = $payAmt / 100;                                // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'zhifu', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('SC000000', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方轻铜支付通知
     */
    public function qtong()
    {
        try {
            if ($this->request->has('reqStreamId') && $this->request->has('payMoney') && $this->request->param('payState') == '0') {
                $order_id = $this->request->param('reqStreamId');        // 平台订单号
                $cash = $this->request->param('face');                   // 充值金额               
                $verify_param = $this->request->param('orderNo');        // 验证参数    
                $other_order_id = $this->request->param('orderNo');      // 第三方订单号         
                $now_cash = $this->request->param('payMoney');           // 实际金额               

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'qtong', true, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方收米支付通知
     */
    public function shoumi()
    {
        try {
            if ($this->request->has('outTradeNo') && $this->request->has('amount') && $this->request->param('code') == '10000') {
                $order_id = $this->request->param('outTradeNo');        // 平台订单号
                $cash = $this->request->param('amount');                // 充值金额               
                $verify_param = $this->request->param('extendParams');  // 验证参数    
                $other_order_id = $this->request->param('tradeNo');     // 第三方订单号         
                $now_cash = $cash;                                      // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'shoumi', true, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方禾管家支付通知
     */
    public function hgjpay()
    {
        try {
            if ($this->request->has('order_id') && $this->request->has('price') && $this->request->param('price') > 0) {
                $order_id = $this->request->param('out_order_id');        // 平台订单号
                $cash = $this->request->param('price');                   // 充值金额               
                $verify_param = $this->request->param('order_id');        // 验证参数    
                $other_order_id = $this->request->param('order_id');      // 第三方订单号         
                $now_cash = $cash;                                        // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'hgjpay', true, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方飞猪支付通知
     */
    public function feizhu()
    {
        try {
            if ($this->request->has('orderid') && $this->request->has('amount') && $this->request->param('returncode') == '00') {
                $order_id = $this->request->param('orderid');               // 平台订单号
                $cash = $this->request->param('request_amount');            // 充值金额               
                $verify_param = $this->request->param('transaction_id');    // 验证参数    
                $other_order_id = $this->request->param('transaction_id');  // 第三方订单号         
                $now_cash = $this->request->param('amount');                // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'feizhu', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('OK', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方98支付通知
     */
    public function sprflat()
    {
        try {
            $data = file_get_contents('php://input');
            $array = json_decode($data, true);
            if (isset($array['status']) && $array['status'] == '0') {

                $order_id = $array['out_trade_no'];                 // 平台订单号
                $cash = $array['total_fee'] / 100;                  // 金额              
                $verify_param = $array['attach'];                   // 验证参数    
                $other_order_id = $array['orderid'];                // 第三方订单号 
                $now_cash = $cash;                                  // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, $array, $cash, $now_cash, $verify_param, $other_order_id, 'sprflat', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方超人支付通知
     */
    public function chaoren()
    {
        try {
            if ($this->request->has('out_order_no') && $this->request->has('trade_money')) {
                $order_id = $this->request->param('out_order_no');            // 平台订单号
                $cash = $this->request->param('trade_money');                 // 充值金额              
                $verify_param = $this->request->param('order_no');            // 验证参数    
                $other_order_id = $this->request->param('order_no');          // 第三方订单号   
                $now_cash = $cash;                                            // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'chaoren', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方紫睿支付通知
     */
    public function zirui()
    {
        try {
            $data = file_get_contents('php://input');
            if ($data) {
                $response = urldecode($data);
                $arrStr = explode('&', $response);
                foreach ($arrStr as $str) {
                    $p = strpos($str, "=");
                    $key = substr($str, 0, $p);
                    $value = substr($str, $p + 1);
                    $data_arr[$key] = $value;
                }
                $event = json_decode($data_arr['event'], true);
                if ($event['order_status'] == '1006') {
                    $order_id = $event['out_order_no'];              // 平台订单号
                    $cash = $event['amount'] / 100;                  // 金额              
                    $verify_param = $event['order_no'];              // 验证参数    
                    $other_order_id = $event['order_no'];            // 第三方订单号 
                    $now_cash = $event['receipt_amount'] / 100;      // 实际金额            

                    $payment_order_obj = new PaymentOrder();
                    $resdata = $payment_order_obj->notifyAbout($order_id, $event, $cash, $now_cash, $verify_param, $other_order_id, 'zirui', false, false, true);
                    if ($resdata == 'success') {
                        return Response::create('SUCCESS', 'html');
                    }
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方东铭支付通知
     */
    public function dongming()
    {
        try {
            if ($this->request->has('partner') && $this->request->has('ordernumber') && $this->request->param('orderstatus') == '1') {
                $order_id = $this->request->param('ordernumber');         // 平台订单号
                $cash = $this->request->param('paymoney');                // 充值金额               
                $verify_param = $this->request->param('attach');          // 验证参数    
                $other_order_id = $this->request->param('sysnumber');     // 第三方订单号         
                $now_cash = $this->request->param('paymoney');            // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'dongming', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('ok', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方简单支付通知
     */
    public function easypay()
    {
        try {
            if ($this->request->has('orderid') && $this->request->has('price') && $this->request->param('status') == '1') {
                $order_id = $this->request->param('orderid');         // 平台订单号
                $cash = $this->request->param('price');               // 充值金额               
                $verify_param = $this->request->param('orderuid');    // 验证参数    
                $other_order_id = $this->request->param('ordno');     // 第三方订单号         
                $now_cash = $this->request->param('realprice');       // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'easypay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方汇付通二支付通知
     */
    public function huifutongtwo()
    {
        try {
            if ($this->request->has('outTradeNo') && $this->request->has('totalFee') && $this->request->param('resultCode') == '1') {
                $order_id = $this->request->param('outTradeNo');           // 平台订单号
                $cash = $this->request->param('totalFee');                 // 金额              
                $verify_param = $this->request->param('outTradeNo');       // 验证参数    
                $other_order_id = $this->request->param('orderNumber');    // 第三方订单号  
                $now_cash = $cash;                                         // 实际金额                

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'huifutongtwo', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('SUCCESS', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方付易通转账支付通知
     */
    public function fuyitongdai()
    {
        try {
            if ($this->request->has('out_trade_no') && $this->request->has('total_fee')) {
                $order_id = $this->request->param('out_trade_no');                  // 平台订单号
                $total_fee = $this->request->param('total_fee');                    // 充值金额,单位为分              
                $verify_param = $this->request->param('attach');                    // 验证参数    
                $other_order_id = $this->request->param('out_trade_no');            // 第三方订单号 
                $cash = $total_fee / 100;                                           // 金额  
                $now_cash = $cash;                                                  // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'fuyitongdai', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方超人二支付通知
     */
    public function chaorentwo()
    {
        try {
            if ($this->request->has('out_order_no') && $this->request->has('trade_money')) {
                $order_id = $this->request->param('out_order_no');            // 平台订单号
                $cash = $this->request->param('trade_money');                 // 充值金额              
                $verify_param = $this->request->param('order_no');            // 验证参数    
                $other_order_id = $this->request->param('order_no');          // 第三方订单号   
                $now_cash = $cash;                                            // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'chaorentwo', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方收呗支付通知
     */
    public function shoubei()
    {
        try {
            if ($this->request->has('pay_trace_no') && $this->request->has('total_amount') && $this->request->param('result_code') == 'PAY_SUCCESS') {
                $order_id = $this->request->param('pay_trace_no');          // 平台订单号
                $orderAmount = $this->request->param('total_amount');       // 充值金额,单位为分                            
                $verify_param = $this->request->param('pay_trace_no');      // 验证参数    
                $other_order_id = $this->request->param('trade_no');        // 第三方订单号   
                $cash = $orderAmount / 100;                                 // 金额      
                $now_cash = $cash;                                          // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'shoubei', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('SUCCESS', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方快捷付通知
     */
    public function kuaijiefu()
    {
        try {
            if ($this->request->has('OrderId') && $this->request->has('PayMoney') && $this->request->param('ErrCode') == '0000') {
                $order_id = $this->request->param('OrderId');                  // 平台订单号
                $cash = $this->request->param('PayMoney');                     // 金额              
                $verify_param = $this->request->param('Attach');               // 验证参数    
                $other_order_id = $this->request->param('TransactionId');      // 第三方订单号  
                $now_cash = $this->request->param('FaceValue');                // 实际金额 

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'kuaijiefu', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('ok', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方榛果支付通知
     */
    public function zhenguo()
    {
        try {
            if ($this->request->has('traceno') && $this->request->has('trade_order') && $this->request->has('total_fee')) {
                $order_id = $this->request->param('traceno');                   // 平台订单号
                $cash = $this->request->param('total_fee');                     // 金额 分             
                $verify_param = $this->request->param('traceno');               // 验证参数    
                $other_order_id = $this->request->param('trade_order');         // 第三方订单号  
                $now_cash = $this->request->param('actual_money');              // 实际金额 分 
                $cash /= 100;                                                   // 金额        
                $now_cash /= 100;                                               // 实际金额        

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'zhenguo', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方森发源支付通知
     */
    public function sfyfu()
    {
        try {
            if ($this->request->has('out_trade_no') && $this->request->has('trade_no') && $this->request->param('status') == '1') {
                $order_id = $this->request->param('out_trade_no');            // 平台订单号
                $cash = $this->request->param('money');                       // 金额              
                $verify_param = $this->request->param('attach');              // 验证参数    
                $other_order_id = $this->request->param('out_trade_no');      // 第三方订单号  
                $now_cash = $this->request->param('money');                   // 实际金额 

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'sfyfu', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方双银支付通知
     */
    public function shuangyin()
    {
        try {
            if ($this->request->has('merchant_order_id') && $this->request->has('order_id') && $this->request->param('status') == '2') {
                $order_id = $this->request->param('merchant_order_id');      // 平台订单号
                $cash = $this->request->param('cash');                       // 金额              
                $verify_param = $this->request->param('order_id');           // 验证参数    
                $other_order_id = $this->request->param('order_id');         // 第三方订单号  
                $now_cash = $this->request->param('cash');                   // 实际金额 

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'shuangyin', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方多银支付通知
     */
    public function duoyin()
    {
        try {
            if ($this->request->has('merchant_order_id') && $this->request->has('order_id') && $this->request->param('status') == '2') {
                $order_id = $this->request->param('merchant_order_id');      // 平台订单号
                $cash = $this->request->param('cash');                       // 金额              
                $verify_param = $this->request->param('order_id');           // 验证参数    
                $other_order_id = $this->request->param('order_id');         // 第三方订单号  
                $now_cash = $this->request->param('cash');                   // 实际金额 

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'duoyin', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方富支付通知
     */
    public function fpay()
    {
        try {
            if ($this->request->has('money') && $this->request->has('pay_money') && $this->request->param('status') == '1') {
                $order_id = $this->request->param('trade_no');              // 平台订单号
                $cash = $this->request->param('money');                     // 金额 分             
                $verify_param = $this->request->param('trade_no');          // 验证参数    
                $other_order_id = $this->request->param('orderid');         // 第三方订单号  
                $now_cash = $this->request->param('pay_money');             // 实际金额 分 
                $cash /= 100;                                               // 金额        
                $now_cash /= 100;                                           // 实际金额        

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'fpay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('{"code":1,"msg":"ok"}', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方蚁窝支付通知
     */
    public function yiwo()
    {
        try {
            if ($this->request->has('orderid') && $this->request->has('amount') && $this->request->param('returncode') == '00') {
                $order_id = $this->request->param('orderid');               // 平台订单号
                $cash = $this->request->param('amount');                    // 金额              
                $verify_param = $this->request->param('orderid');           // 验证参数    
                $other_order_id = $this->request->param('transaction_id');  // 第三方订单号  
                $now_cash = $this->request->param('amount');                // 实际金额 

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'yiwo', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('OK', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方天诚支付通知
     */
    public function tiancheng()
    {
        try {
            if ($this->request->has('customno') && $this->request->has('money') && $this->request->param('state') == '1') {
                $order_id = $this->request->param('customno');               // 平台订单号
                $cash = $this->request->param('money');                      // 金额              
                $verify_param = $this->request->param('customno');           // 验证参数    
                $other_order_id = $this->request->param('orderno');          // 第三方订单号  
                $now_cash = $this->request->param('money');                  // 实际金额 

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'tiancheng', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('OK', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方信汇支付通知
     */
    public function xinhuipay()
    {
        try {
            if ($this->request->has('amount') && $this->request->has('merchantNo') && $this->request->param('rtnCode') == '0000') {
                $order_id = $this->request->param('tranFlow');               // 平台订单号
                $cash = $this->request->param('amount');                     // 金额              
                $verify_param = $this->request->param('tranFlow');           // 验证参数    
                $other_order_id = $this->request->param('paySerialNo');      // 第三方订单号  
                $cash /= 100;                                                // 金额        
                $now_cash = $cash;                                           // 实际金额        

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'xinhuipay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方易宝支付通知
     */
    public function yibao()
    {

        include_once Env::get('extend_path') . 'yibaoSdk/lib/Util/YopSignUtils.php';

        $merchantNo = 10018967794;
        $parentMerchantNo = 10018967794;
        $private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCg9E4XuqwRV3hoLp8SFdWdDGarhblSBkVIKy3kVEGQ6P9L6Mkt2izFi3Sb11PDF1kaccU/35X2xCscLkrOm8tMdav17J45ND2xk6xHgH3+E/DJoE3whR5F06LOBYgy9s4v14kYeLJ79yOUrHM8ZbUuysF+IjdWN5fFu1IZKcdJYIiUZT2UdCHOBx3fYtekz9Czsihz/uOjBOq/yq85dD7WgJazVWg0SzAfL8F+6/C5Nn8ibDYFnLyt1hvZp77eKZ6bY1INM0xV+PHRPfNgwbc9ntpLc8F48JmAGJGBDaHqvW3F/fNBHnWJ8WR1t9kGnm4/1ZRrapzMXwLSuIDxEjTjAgMBAAECggEAFApXLt0vT3l0pIQpijbtwgApSHH+ARiGx9WYgTV8dG6OWwVBB1SC/pW+jyjgZQojLge8Z5ePNIp4U6nv5om/ZmXAY35ytOysQdABQ2XcSiZxdKlhCvGIM2mGe+B0dOQGCC7uAv4EOysqYviV4I9JX+oe7XWVLkb9vsD0F+37wkbwFq6MSYBhnHDd0/g2f5IfgJaJzx9LuArmWKd8qdK643IU/K+9yI3+N2uxIqxTjxIZ16IEN5s3jiVHhIbxwEMnYBkUa/znX7X1Gon0C5eDrBIdwqN58UAJMFeoIkQOQNsaOTC497oiMl7sU1TV4Bt/JqxseCqGHXT4QFpV26LRAQKBgQDXjYuLSJdHasNK4jiBLStLEJ9gmF/+bPQ3dLJnL+IEOpOfIALFPSTukBPXFen1Mc6VallYc6Imj2iNqV8IrbC3KCZlWxnsNdPTxqFsrepilKePgLtzm+J9cOWv9LnKyGvGwpTBOsfKJuTLi7nrUmCKil5165PoqarGh6zIsRXRdQKBgQC/KAXGn8twEl8cH5x017+oL+9RN7Iht92NCGbsIzCzY0yTuVLPYTIXOXcBDLoBsmWgIJyIb9z/PKUYbBDMDK3fURciv5xIIz2P+JIHh09SiiovCOydhugikq+addva/uNgGihf8KgtgSG4d4IoR0XxshclYgDsGtOuEj45EQgJ9wKBgHLbKFUSXBGg8Ojw+9zRHbWE6PfGmbfvhH4cP4e+Ove34rsyimdg+lHoEbpVIfIWFRcGsQ7xpqBXYAXEDzCHpJcj3Lm7PmfgErxQpelMDo1y2oobtUaX9KqUwr7sbyd/ffZN7oe784NjEBzpmiqrHWgU7Np2qbya07Wvy8Cwo4iVAoGBAIfc9l357So2pIrknNsfDQWJLFtZbq4wdLNsqVpkmJSnmyHTslvbBTMkkMSaOwpBtaFeDGOcvkJa5Cy7giTFTj9O71avQXC0O2k8ju3y6hoMQXc0rJg57nvELjNmWWEJkKoZbWDjN2VARqtJpaTjI39pyLG1OlqVpqYuKTN+O2x5AoGBAKaD9ogs0TTr4wVj/zPUyIe/a5iroOtIV1xRNKgECckTA6kJg/yKPNAeRGVnNAPW0Q2pwFEQjPCaDQHEP7FRrx0oJ3it4qGmbRk5Zu24/x+KUksStcux19FCA9zgjBSYcB3ySEwupA4aa0atxDwRrj7WYUpNslIwLGFmGLvkKMMR";
        $yop_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6p0XWjscY+gsyqKRhw9MeLsEmhFdBRhT2emOck/F1Omw38ZWhJxh9kDfs5HzFJMrVozgU+SJFDONxs8UB0wMILKRmqfLcfClG9MyCNuJkkfm0HFQv1hRGdOvZPXj3Bckuwa7FrEXBRYUhK7vJ40afumspthmse6bs6mZxNn/mALZ2X07uznOrrc2rk41Y2HftduxZw6T4EmtWuN2x4CZ8gwSyPAW5ZzZJLQ6tZDojBK4GZTAGhnn3bg5bBsBlw2+FLkCQBuDsJVsFPiGh/b6K/+zGTvWyUcu+LUj2MejYQELDO3i2vQXVDk7lVi2/TcUYefvIcssnzsfCfjaorxsuwIDAQAB";
        $url = "https://openapi.yeepay.com/yop-center";
        $data = $this->request->param('response');
        // $resdata = \YopSignUtils::decrypt($data, $private_key, $yop_public_key);
        $resarray = json_decode($resdata, true);
        try {
            if (isset($resarray['status']) && $resarray['status'] == 'SUCCESS') {
                $order_id = $resarray['orderId'];                // 平台订单号
                $cash = $resarray['orderAmount'];                // 金额              
                $verify_param = $resarray['orderId'];            // 验证参数    
                $other_order_id = $resarray['uniqueOrderNo'];    // 第三方订单号 
                $now_cash = $resarray['payAmount'];              // 实际金额      

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, $resarray, $cash, $now_cash, $verify_param, $other_order_id, 'yibao', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('SUCCESS', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方连连支付通知
     */
    public function lianlian()
    {
        try {
            $res = file_get_contents('php://input');
            $resarray = json_decode($res, true);
            if (isset($resarray['result_pay']) && $resarray['result_pay'] == 'SUCCESS') {
                $order_id = $resarray['no_order'];                           // 平台订单号
                $cash = $resarray['money_order'];                            // 金额              
                $verify_param = $resarray['oid_paybill'];                    // 验证参数    
                $other_order_id = $resarray['oid_paybill'];                  // 第三方订单号 
                $now_cash = $cash;                                           // 实际金额        

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, $resarray, $cash, $now_cash, $verify_param, $other_order_id, 'lianlian', false, false, true);
                if ($resdata == 'success') {
                    $res = '{"ret_code":"0000","ret_msg":"交易成功"}';
                    return Response::create($res, 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方商易通支付通知
     */
    public function shangyitong()
    {
        try {
            if ($this->request->has('mch_id') && $this->request->has('out_trade_no')) {
                $order_id = $this->request->param('out_trade_no');               // 平台订单号
                $cash = $this->request->param('order_amount');                   // 金额              
                $verify_param = $this->request->param('out_trade_no');           // 验证参数    
                $other_order_id = $this->request->param('out_trade_no');         // 第三方订单号  
                $now_cash = $this->request->param('order_amount');               // 实际金额 

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'shangyitong', false, false, true);
                if ($resdata == 'success') {
                    $res = '{"status_code":200}';
                    return Response::create($res, 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方火影支付通知
     */
    public function huoying()
    {
        try {
            if ($this->request->has('merchantid') && $this->request->has('money')) {
                $order_id = $this->request->param('merchantorder');         // 平台订单号
                $cash = $this->request->param('money');                     // 金额              
                $verify_param = $this->request->param('merchantorder');     // 验证参数    
                $other_order_id = $this->request->param('orderid');         // 第三方订单号  
                $now_cash = $this->request->param('money');                 // 实际金额 
                $cash /= 100;
                $now_cash /= 100;

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'huoying', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('Success', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方掌宜支付通知
     */
    public function zhangyi()
    {
        try {
            if ($this->request->has('out_trade_no') && $this->request->has('money') && $this->request->param('code') == '0') {
                $order_id = $this->request->param('out_trade_no');          // 平台订单号
                $cash = $this->request->param('money');                     // 金额              
                $verify_param = $this->request->param('qn');                // 验证参数    
                $other_order_id = $this->request->param('invoice_no');      // 第三方订单号  
                $cash /= 100;                                               // 金额        
                $now_cash = $cash;                                          // 实际金额        

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'zhangyi', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('0', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方银联支付通知
     */
    public function chinaums()
    {
        try {
            if ($this->request->has('totalAmount') && $this->request->has('merOrderId') && $this->request->param('status') == 'TRADE_SUCCESS') {
                $order_id = $this->request->param('merOrderId');           // 平台订单号
                $cash = $this->request->param('totalAmount');              // 金额              
                $verify_param = $this->request->param('attachedData');     // 验证参数    
                $other_order_id = $this->request->param('targetOrderId');  // 第三方订单号  
                $now_cash = $this->request->param('receiptAmount');        // 实际金额 
                $cash /= 100;                                              // 金额    
                $now_cash /= 100;                                          // 实际金额
                $order_id = substr($order_id, 4);

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'chinaums', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('SUCCESS', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方汇潮支付通知
     */
    public function huichao()
    {
        try {
            if ($this->request->has('BillNo') && $this->request->has('Amount') && $this->request->param('Succeed') == '88') {
                $order_id = $this->request->param('BillNo');           // 平台订单号
                $cash = $this->request->param('Amount');               // 充值金额               
                $verify_param = $this->request->param('BillNo');       // 验证参数    
                $other_order_id = $this->request->param('OrderNo');    // 第三方订单号         
                $now_cash = $this->request->param('Amount');           // 实际金额               

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'huichao', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('ok', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方传化支付通知
     */
    public function chuanhua()
    {
        try {
            if ($this->request->has('appid') && $this->request->has('businessnumber') && $this->request->param('status') == '成功') {
                $order_id = $this->request->param('businessnumber');                // 平台订单号
                $cash = $this->request->param('billamount');                        // 充值金额               
                $verify_param = $this->request->param('businessrecordnumber');      // 验证参数    
                $other_order_id = $this->request->param('businessrecordnumber');    // 第三方订单号         
                $now_cash = $this->request->param('transactionamount');             // 实际金额               

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'chuanhua', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('{"result":"success","msg":"请求成功"}', 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方微信支付通知
     */
    public function wxpay()
    {
        try {
            if ($this->request->has('event_type') && $this->request->param('event_type') == 'TRANSACTION.SUCCESS') {

                $gs = $this->request->param('gs');
                $redis = Cache::store('redis');
                $gs_info = $redis->get($gs);
                $gs_info_key = $gs_info['value']['key'];

                $resource = $this->request->param('resource');

                $nonce = $resource['nonce'];
                $associated_data = $resource['associated_data'];
                $ciphertext = $resource['ciphertext'];
                $ciphertext = base64_decode($ciphertext);

                $data_json = sodium_crypto_aead_aes256gcm_decrypt($ciphertext, $associated_data, $nonce, $gs_info_key);
                $data = json_decode($data_json, true);

                $order_id = $data['out_trade_no'];             // 平台订单号
                $cash = $data['amount']['total'];              // 金额              
                $verify_param = $data['attach'];               // 验证参数    
                $other_order_id = $data['transaction_id'];     // 第三方订单号 
                $now_cash = $data['amount']['payer_total'];    // 实际金额      
                $cash /= 100;
                $now_cash /= 100;

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, $data, $cash, $now_cash, $verify_param, $other_order_id, 'wxpay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('{"code":"SUCCESS","message":""}', 'html');
                }
            }

            $xml = file_get_contents('php://input');
            $data = str_replace('\/', '/', $xml);
            $xml_obj = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA);
            $xml_json = json_encode($xml_obj, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
            $resarray = json_decode($xml_json, true);

            if (isset($resarray['result_code']) && $resarray['result_code'] == 'SUCCESS') {
                $order_id = $resarray['out_trade_no'];          // 平台订单号
                $cash = $resarray['total_fee'];                 // 金额              
                $verify_param = $resarray['attach'];            // 验证参数    
                $other_order_id = $resarray['transaction_id'];  // 第三方订单号 
                $now_cash = $resarray['cash_fee'];              // 实际金额      
                $cash /= 100;
                $now_cash /= 100;

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, $resarray, $cash, $now_cash, $verify_param, $other_order_id, 'wxpay', false, false, true);
                if ($resdata == 'success') {
                    $res = '<xml><return_code><![CDATA[SUCCESS]]></return_code> <return_msg><![CDATA[OK]]></return_msg></xml>';
                    return Response::create($res, 'html');
                }
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    /**
     * 第三方支付宝支付通知
     */
    public function zfbpay()
    {
        try {
            if ($this->request->has('out_trade_no') && $this->request->has('subject') && $this->request->param('trade_status') == 'TRADE_SUCCESS') {
                $order_id = $this->request->param('out_trade_no');         // 平台订单号
                $cash = $this->request->param('total_amount');             // 金额              
                $verify_param = $this->request->param('body');             // 验证参数    
                $other_order_id = $this->request->param('trade_no');       // 第三方订单号 
                $now_cash = $this->request->param('receipt_amount');       // 实际金额            

                $payment_order_obj = new PaymentOrder();
                $resdata = $payment_order_obj->notifyAbout($order_id, input(), $cash, $now_cash, $verify_param, $other_order_id, 'zfbpay', false, false, true);
                if ($resdata == 'success') {
                    return Response::create('success', 'html');
                }
            }
            // 支付宝订单交易关闭也会通知
            if ($this->request->param('trade_status') == 'TRADE_CLOSED') {
                return Response::create('success', 'html');
            }
            // 支付宝订单交易完结也会通知
            if ($this->request->param('trade_status') == 'TRADE_FINISHED') {
                return Response::create('success', 'html');
            }
            return ['code' => 999, 'msg' => '404'];
        } catch (\Exception $e) {
            payment_log(110000, input(), $e->getMessage(), false);
            abort(404, '页面不存在');
        }
    }

    //payment_error_log(147, input());
    //payment_error_log(258, file_get_contents('php://input'));
}
